/**
 *
 */
package com.elite.groovy.callback


import com.elite.groovy.kh.getProperty
import com.elite.groovy.util.EliteBean
import com.elite.groovy.util.Util
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory
import com.elite.groovy.kh.DHAESUtil
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
/**
 * @author ThinkPad
 *
 */
class aesutilEncryptFast implements ServiceBackInvoke {
    private static final Log log=LogFactory.getLog(aesutilEncryptFast.class);

    String doCallBack(EliteBean eliteBean, HttpServletRequest request, HttpServletResponse response) {

        def body1= Util.getRequestBody(request,"utf-8");
        log.debug("body1----------------:"+body1);
        // def str1 = URLDecoder.decode(body1, "utf-8");

        String assertKey = getProperty.get("FastAESPassword")
        String aesEncryptString= DHAESUtil.encrypt(body1, assertKey);
        String aesDecryptString= DHAESUtil.decrypt(aesEncryptString,assertKey) ;
        log.debug("加密后的数据是："+aesEncryptString);
        log.debug("解密后的数据是："+aesDecryptString);
        return aesEncryptString;
    }

}